/**
 * Desc :
 * Wiki :
 * User : peimingxiao_dxm
 * Date : 2022/11/30 10:52
 */

package main

import (
	"fmt"
	"strconv"
)

func main() {
	atoi, err := strconv.Atoi("100")
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Printf("Tyep:%T, value:%d\n", atoi, atoi)
		// Tyep:int, value:100
	}

	itoa := strconv.Itoa(atoi)
	fmt.Printf("Type:%T, values:%s\n", itoa, itoa)
	// Type:string, values:100

	parseBool, err := strconv.ParseBool("true")
	fmt.Printf("Type:%T, value:%+v\n", parseBool, parseBool)
	// Type:bool, value:true

	float, err := strconv.ParseFloat("1.234", 64)
	fmt.Printf("Type:%T, value:%+v\n", float, float)
	// Type:float64, value:1.234

	parseInt, err := strconv.ParseInt("-2", 10, 64)
	fmt.Printf("Type:%T, value:%+v\n", parseInt, parseInt)
	// Type:int64, value:-2

	parseUint, err := strconv.ParseUint("3", 10, 32)
	fmt.Printf("Type:%T, value:%+v\n", parseUint, parseUint)
	// Type:uint64, value:3

	formatBool := strconv.FormatBool(true)
	fmt.Printf("Type:%T, value:%+v\n", formatBool, formatBool)
	// Type:string, value:true

	formatInt := strconv.FormatInt(-2, 16)
	fmt.Printf("Type:%T, value:%+v\n", formatInt, formatInt)
	// Type:string, value:-2

	formatFloat := strconv.FormatFloat(1.22222, 'E', -1, 64)
	fmt.Printf("Type:%T, value:%+v\n", formatFloat, formatFloat)
	// Type:string, value:1.22222E+00

	formatUint := strconv.FormatUint(2, 16)
	fmt.Printf("Type:%T, value:%+v\n", formatUint, formatUint)
	// Type:string, value:2

	isPrint := strconv.IsPrint(' ')
	fmt.Println(isPrint)

	backquote := strconv.CanBackquote("\t")
	fmt.Println(backquote)
}
